<template>
  <BaseIndex ref="baseIndexRef" title="${headerName}"
    :base="base"                 :page="page"           :formItems="formItems"      :baseColumns="baseColumns"
    :formSearch="formSearch"     :formAdd="formAdd"     :formUpdate="formUpdate"    :info="info"
    :searchExcludes="searchExl"  :addExcludes="addExl"  :updateExcludes="updateExl"
    @search="doSearch(search)"   @add="doAdd"           @update="doUpdate"
    @deleteByIds="doDeleteByIds" @openAdd=""            @openUpdate="openUpdate"    @openInfo="openInfo"
  >
    <!-- <template #search></template> -->
    <!-- <template #table></template> -->
    <!-- <template #add></template> -->
    <!-- <template #update></template> -->
    <!-- <template #info></template> -->
  </BaseIndex>
</template>

<script lang="ts" setup>
import api from '@/axios/api';
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { base, AllFormKeysArrType } from './base';
import BaseIndex from '@/components/base/baseIndex.vue';
import { ${dv}, baseColumns, formItems } from './main';
import { BaseIndexInstance } from '@/components/base/common';
import { useBaseAdd, useBaseIndex, useBaseUpdate } from '@/components/base/baseHook';

const baseIndexRef = ref({} as BaseIndexInstance);
const { formSearch, page, search, doSearch, doDeleteByIds, info, openInfo } = useBaseIndex<${dv}>(base, baseIndexRef);
const { formAdd, add, doAdd } = useBaseAdd<${dv}>(base, baseIndexRef, search);
const { formUpdate, update, doUpdate, openUpdate } = useBaseUpdate<${dv}>(base, baseIndexRef, search);
const searchExl: AllFormKeysArrType = ['${idName}'];
const addExl: AllFormKeysArrType = ['createTime', 'updateTime', '${idName}'];
const updateExl: AllFormKeysArrType = ['createTime', 'updateTime', '${idName}'];

onMounted(() => {
  search();
})
</script>

<style lang="scss" scoped></style>
